


<!DOCTYPE html>
<html>
<head>
<html>
<head>
<meta charset ="UTF-8">
<title>登录</title>
     <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
     <link href="./style.css" rel="stylesheet">
     <script src="../bootstrap/js/jQuery.min.js"></script>
     <script src="../bootstrap/js/bootstrap.min.js"></script>
         <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">
    <link href="__PUBLIC__/assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/assets/css/dashboard.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="__PUBLIC__/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>
<style >
	body{
		font-family: '行楷';font-size: 25px; margin:0 auto;
	}
</style>
<body>

<div class="container">
<form  name="form1" action="{:U('index/login')}" method="post" onsubmit="return sub()" class="form-horizontal">

<center><label><h2>请填写登录信息</h2></label>

        <div class="form-group">
	    <label for="username1" class="col-sm-3 control-label" ><font face="行楷" size="4" >姓名</label>
	     <div class="col-sm-7">
		<input type="text"    class="form-control" placeholder="姓名" required="" id="username1" name="username"></input>
		</div>
		</div>
	
	
	 <div class="form-group">
	    <label for="password1" class="col-sm-3 control-label" >密码</label>
	     <div class="col-sm-7">
		<input type="passward"    class="form-control" placeholder="密码" id="password1" name="password"></input>
		</div>
		</div>

	 
 <SCRIPT LANGUAGE="JavaScript">  
        function createCode(len)  
        {  
            var seed = new Array(  
                    'abcdefghijklmnopqrstuvwxyz',  
                    'ABCDEFGHIJKLMNOPQRSTUVWXYZ',  
                    '0123456789'  
            );               //创建需要的数据数组  
            var idx,i;  
            var result = '';   //返回的结果变量  
            for (i=0; i<len; i++) //根据指定的长度  
            {  
                idx = Math.floor(Math.random()*3); //获得随机数据的整数部分-获取一个随机整数  
                result += seed[idx].substr(Math.floor(Math.random()*(seed[idx].length)), 1);//根据随机数获取数据中一个值  
            }  
            return result; //返回随机结果  
        }  
  
        function test() {  
            var inputRandom=document.getElementById("inputRandom").value;  
            var autoRandom=document.getElementById("autoRandom").innerHTML;  
            if(inputRandom==autoRandom) {  
                alert("通过验证");  
            } else {  
                alert("没有通过验证");  
            }  
  
       }  
    </SCRIPT>  
    <SELECT id="sel" class="hidden">  
    <option value=1>1</option>  
    <option value=3>3</option>  
    <option value=5>5</option>  
    <option value=7 selected>7</option>  
    <option value=9>9</option>  
</SELECT>  

 <div class="form-group">
	    <label for="inputRandom" class="col-sm-3 control-label" >验证码</label>
	    <div class="col-sm-7">
          <input type="text" id="inputRandom" class="form-control" placeholder="验证码"> 
          <br>
       <label id="autoRandom" value=""></label>
       <INPUT TYPE="button"  class="btn btn-primary" VALUE="获取验证码" ONCLICK="autoRandom.innerHTML=createCode(sel.value)">  
        <input type="button" class="btn btn-warning" value="验证" onclick="test()">  
        </INPUT></div></div>
 
<script type="text/javascript">  
    window.onload()=autoRandom.innerHTML=createCode(sel.value);  
</script> 

<div class="form-group" >
	   <label for="in" class="col-sm-3 control-label"> </label>
		<div class="col-sm-6">
	    <input type="submit"  value="登录"   class="btn btn-success" style="font-size:20px" > </label>
	</div>
	</div>
	
</center>
</form>
	</div>
	
	
	</body>

